<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="javax.sql.rowset.WebRowSet" %>
<%

request.setCharacterEncoding("utf-8");
String admin_id=request.getParameter("admin_id");
String admin_pwd = request.getParameter("admin_pwd");
String restaurant_id ="",adminid="";

boolean checkOK =false;
javax.sql.rowset.WebRowSet rs = com.myweb.DBTools.getRS("SELECT * FROM admin WHERE restaurant_id=1");
if(rs.next()){
	String pwd =rs.getString("admin_pwd");
	restaurant_id =rs.getString("restaurant_id");
	//adminid =rs.getString("admin_id");
    /*if(pwd.equals(admin_pwd)){
        checkOK =true;
    }*/
    checkOK = pwd.equals(admin_pwd);
}
rs.close();

if(checkOK){
	//如果登录成功，保存当前管理员编号、酒店编号到session
	session.setAttribute("restaurant_id",restaurant_id);
	//session.setAttribute("adminid",hotel_id);
    response.sendRedirect("hahome.jsp");
  }else{
    response.sendRedirect("ownerlogin.jsp");
 }


%>